<template>
    <div>
        <div>pinna</div>
        <div>sum:{{useNumber.sum}}</div> 
        <div>age:{{useNumber.age}}</div>
        <el-button @click="btnClick">点击获取</el-button>
    </div>
</template>
<script>
import { defineComponent, onMounted } from 'vue'
import  useStore from '@/store'
import  { storeToRefs } from 'pinia'
export default defineComponent({
    name:'sum',
    setup() {
        onMounted(()=>{

        })
        const {useNumber } = useStore()
        // const { sum,age } = storeToRefs(useNumber)
        let btnClick = ()=>{
              console.log(useNumber)
              useNumber.getSum()
        }
        return {
            btnClick,
            useNumber
        }
    },
})
</script>
